{% extends "master.html" %}
{% block body %}
<div class="table">
    {% if not passwords %}
        <div class="message">You don't have any password, <a href="/new">create a new password</a>.</div>
    {% else %}
    <table>
        <tr>
            <th class="category">Category</th>
            <th class="login">Login</th>
            <th class="view" >View</th>
            <th class="edit">Edit</th>
            <th class="delete">Delete</th>
        </tr>
        {% for pwd in passwords %}
        <tr id="row{{ forloop.counter }}">
            <form class='form' method='post' action='check'>
            <td class="category">{{ pwd.category }}</td>
            <td class="login">{{ pwd.login }}</td>
            <td class="view">
                <input name='view' value='View' type='submit' id='view' />
            </td>
            <td class="edit">
                <input name='edit' value='Edit' type='submit' id='edit' />
            </td>
            <td class="delete">
                <input name='delete' value='Delete' type='submit' id='delete' />
            </td>
            <input name='key' value='{{ pwd.key }}' type='hidden' id='key' />
            </form>
        </tr>
        {% endfor %}
    </table>
    {% endif %}
</div>
{% endblock %}
